﻿using System;
using System.Windows.Forms;
using Microsoft.Office.Interop.Word;

namespace CodeCounsel.Office.WordSourceViewer
{
    public partial class TaskPane : UserControl
    {
        public Document Document { get; set; }

        public TaskPane()
        {
            InitializeComponent();
        }

        internal void RefreshSource(string wordProcessingML)
        {
            _sourceField.Text = Transform.ConvertToContentString(wordProcessingML);
        }

        internal string GetWordprocessingML()        
        {
            return Transform.ConvertToWordprocessingMLDocument(_sourceField.Text);
        }

        internal void Clear()
        {
            _sourceField.Text = "";
            _sourceField.Refresh();
        }
    }
}
